#include <stdio.h>
#include <unistd.h>

int main()
{
    int cnt = 10;
    while(cnt >= 0)
    {
        printf("%-2d\r", cnt);
        fflush(stdout);
        usleep(1000000); //1s = 1000ms = 1000000us
        //sleep(1);
        cnt--;
    }
    printf("\n");
    return 0;
}
